home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_1.3 / Read-Me1.3 / Workbench1.3 / Ieee.Examples / Div0 / setjmp.asm < prev    next >
Encoding:
Assembly Source File  |  1988-02-11  |  624 b   |  32 lines

  1.  
  2.  
  3.     XDEF    _setjmp
  4.     XDEF    _longjmp
  5.  
  6. *
  7. *   setjmp( jmpvec ) -- marks a place in the calling stack than may be
  8. *    later longjmp'ed to.  Will return 0 if it is the initial setjmp,
  9. *    and the longjmp code if it is longjmp'ed to.
  10. *
  11. *   longjmp( jmpvec, code ) -- jumps to the saved jmpvec, passing the
  12. *    code along.
  13. *
  14. *   jmpvec should be an array of 13 longs.  The first element is the
  15. *    saved return pc.  The others are the saved registers.
  16. *
  17. _setjmp:
  18.     move.l    4(a7),a0
  19.     movem.l    d2-d7/a2-a7,4(a0)
  20.     move.l    (a7),(a0)
  21.     moveq    #0,d0
  22.     rts
  23.  
  24. _longjmp:
  25.     move.l    4(a7),a0
  26.     move.l    8(a7),d0
  27.     movem.l    4(a0),d2-d7/a2-a7
  28.     move.l    (a0),(a7)
  29.     rts
  30.  
  31.     END
  32.